<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<script type="text/javascript">
function masterDelete(){
	var msg = "确定删除版主？";
	ans = confirm(msg);
    if (!ans) {
        return;
    }
	var array = {};
	array['page.pageIndex'] = $("#page_pageIndex").val();
	array['page.pageSize'] = $("#page_pageSize").val();
	array['boardId'] = $("#boardId").val();
	var url = "<c:url value='/admin/bbs/masterDelete.do' />";
	sns.toRemove(url, array, 'ck_masters','masterIds');
}
function masterCreate(){
	var boardId = '<c:out value="${boardId}"/>';
	var url = "<c:url value='/admin/bbs/masterCreate.do?boardId=" + boardId +"' />";
	window.location.href = url;
}
function masterView(){
}

</script>
<div class="bu">
<button onclick="masterCreate()" class="btn3_mouseout" onmouseover="this.className='btn3_mouseover'"
onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'"
onmouseup="this.className='btn3_mouseup'" title="Create"><fmt:message key="html.admin.master.add"/></button>&nbsp;&nbsp;
<button onclick="masterDelete()" class="btn3_mouseout" onmouseover="this.className='btn3_mouseover'"
onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'"
onmouseup="this.className='btn3_mouseup'"title="delete"><fmt:message key="html.admin.master.delete"/></button>&nbsp;&nbsp;
<button onclick="masterView()" class="btn3_mouseout" onmouseover="this.className='btn3_mouseover'"
onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'"
onmouseup="this.className='btn3_mouseup'"title="view"><fmt:message key="html.admin.master.view"/></button>&nbsp;&nbsp;
</div>
<div>
<table id="t_master_list" width="100%"  border="0" cellpadding="0" cellspacing="0" class="pub_list01">
	<thead>
		<tr>
			<th width="50px" class="tdCenter">
			</th>
			<th width="75px" class="tdCenter">版主名称</th>
			<th width="75px" class="tdCenter">版主等级</th>
		</tr>
	</thead>
	<tbody>
		<c:forEach var="master" items="${page.items}" varStatus="status">
		<tr>
			<td class="tdCenter">
				<input type="checkbox" name="ck_masters" id="ck_<c:out value='${master.masterId}' />" value="${master.masterId}"></input>
			</td>
			<td class="tdCenter">
				<c:out value="${master.nickname}"></c:out>
			</td>
			<td class="tdCenter">
				<c:if test="${master.levels == 1}">
					超级版主
				</c:if>
				<c:if test="${master.levels == 2}">
					高级版主
				</c:if>
				<c:if test="${master.levels == 3}">
					普通版主
				</c:if>
			</td>
		</tr>
		</c:forEach>
	</tbody>
</table>
<jsp:include page="/common/pager.jsp" />
</div>
<br/>
<div class="descr">
	超级版主：对所有版块都具有管理权限。  高级版主：对某个主版块下的所有子版块具有管理权限
	普通版主：对某个子版块具有管理权限
</div>
<br/>
<div class="bu">
<button onclick="masterCreate()" class="btn3_mouseout" onmouseover="this.className='btn3_mouseover'"
onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'"
onmouseup="this.className='btn3_mouseup'" title="Create"><fmt:message key="html.admin.master.add"/></button>&nbsp;&nbsp;
<button onclick="masterDelete()" class="btn3_mouseout" onmouseover="this.className='btn3_mouseover'"
onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'"
onmouseup="this.className='btn3_mouseup'"title="delete"><fmt:message key="html.admin.master.delete"/></button>&nbsp;&nbsp;
<button onclick="masterView()" class="btn3_mouseout" onmouseover="this.className='btn3_mouseover'"
onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'"
onmouseup="this.className='btn3_mouseup'"title="view"><fmt:message key="html.admin.master.view"/></button>&nbsp;&nbsp;
</div>